using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using CubicFWNet.Data.Models;

namespace CubicFWNet.Data.Models.Mapping
{
    public class DeliveryProductMap : EntityTypeConfiguration<DeliveryProduct>
    {
        public DeliveryProductMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.ProductName)
                .HasMaxLength(64);

            this.Property(t => t.ProductFormat)
                .HasMaxLength(64);

            this.Property(t => t.ProductUnit)
                .HasMaxLength(64);

            // Table & Column Mappings
            this.ToTable("DeliveryProduct");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.InvoiceId).HasColumnName("InvoiceId");
            this.Property(t => t.ProductId).HasColumnName("ProductId");
            this.Property(t => t.ProductName).HasColumnName("ProductName");
            this.Property(t => t.ProductSizeWidth).HasColumnName("ProductSizeWidth");
            this.Property(t => t.ProductSizeLenth).HasColumnName("ProductSizeLenth");
            this.Property(t => t.ProductFormat).HasColumnName("ProductFormat");
            this.Property(t => t.ProductUnit).HasColumnName("ProductUnit");
            this.Property(t => t.ProductAmount).HasColumnName("ProductAmount");
            this.Property(t => t.ProductPrice).HasColumnName("ProductPrice");
            this.Property(t => t.TotalMoney).HasColumnName("TotalMoney");
            this.Property(t => t.ProductTax).HasColumnName("ProductTax");
        }
    }
}
